package org.dlow.register;

import org.dlow.common.constants.Register;
import org.dlow.spi.ExtensionLoader;

import java.io.IOException;

/**
 * @description:
 * @Author: 山沐与山
 * @CreateTime: 2024-05-10 21:11
 */
public class RegistryProviderFactory {


    public static ServiceRegistry get(Register register){
        return ExtensionLoader.getInstance().get(register.name);
    }


    public static ServiceRegistry get(String name){
        return ExtensionLoader.getInstance().get(name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(ServiceRegistry.class);
    }
}
